package com.bjtu.transactionclient.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author caiyuli
 * @date 2020/4/25 12:33 下午
 */
public class LocalDateTimeAndStringUtil {

    private static DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    public static LocalDateTime stringToLocalDateTime(String dateTime){
        LocalDateTime ldt = LocalDateTime.parse(dateTime,df);
        return ldt;
    }

    public static String localDateTimeToString(LocalDateTime dateTime){
        String localTime = df.format(dateTime);
        return localTime;
    }


}
